import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex);
const store = new Vuex.Store({
  state: {
    isLoading:false,
    index: 0,
    showTabbar:true,
    user_token:localStorage.getItem('user_token'),
    response:{}
  },
  mutations: {
    changeIndex(state, index) {
      state.index = index;
    },
    changeShowTabbar(state, status) {
      state.showTabbar = status;
    },
    updateLoadingStatus(state,status){
      state.isLoading = status;
    },
    showErrorMsg(state, response) {
      state.response = response;
    },
  }
});
// 这里你可能已经有其他 module

store.registerModule('vux', { // 名字自己定义

});
export default store;
